import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '接收人',
    align: "center",
    dataIndex: 'toUser_dictText'
  },
  {
    title: '发送文件',
    align: "center",
    dataIndex: 'sendFile',
  },
     {
    title: '发送时间',
    align:"center",
    sorter: true,
    dataIndex: 'createTime'
   },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '接收人',
    field: 'toUser',
    component: 'JSearchSelect',
    componentProps:{
      dict: "sys_user,realname,username"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入接收人!'},
             ];
    },
  },
  {
    label: '发送文件',
    field: 'sendFile',
    component: 'JUpload',
    componentProps:{
     },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入发送文件!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  toUser: {title: '接收人',order: 0,view: 'sel_search', type: 'string',dictTable: "sys_user", dictCode: 'username', dictText: 'realname',},
  sendFile: {title: '发送文件',order: 1,view: 'file', type: 'string',},
};
